package org.shopen.ai.puremvc.controller
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import org.shopen.ai.puremvc.model.StateProxy;

	public class HandleStateChangedCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void
		{
			var state : String = StateProxy.STATE_UNDEFINED;
			if (notification.getType() != null)
			{
				state = notification.getType();
			}
			var proxy : StateProxy = facade.retrieveProxy(StateProxy.NAME) as StateProxy;
			proxy.currentState = state;
		}		
	}
}